package helpers;

import java.util.Date;
import Model.TaskManager;

/**
 * The mock factory required by the assignment
 *  This creates a few tasks before hand for the
 *  Task manager.
 * @author psyomn
 */
public class MockFactory extends TaskManagerFactory 
{
    @Override
    public TaskManager getNewTaskManager() throws Exception
    {

        if (Configuration.getAttribute("debugmessages").equals("true"))
            System.out.println("Running with Mock TaskManager");

        TaskManager tm = new TaskManager();

        tm.addTask("Mock example1", new Date(), "Single", null);
        tm.addTask("Mock example2", new Date(), "Periodic", "Weekly");
        tm.addTask("Mock example3", new Date(), "Complex", null);
        tm.addSubTask("Mock example3", "subtask2", "Single", null, new Date());
        tm.addSubTask("Mock example3", "subtask3", "Single", null, new Date());
        tm.addSubTask("Mock example3", "subtask4", "Single", null, new Date());

        return tm;
    }

}
